Third party application scriptability

ABSTRACT

A system and method for allowing third-party script developers to create secure scripts that can safely be incorporated into software applications is disclosed. The system may provide the flow and mechanisms for enabling a client/server secure scripting environment to be added to a hosted software application development environment so that third-party scripts can be added to software applications without application developers having to be concerned about protecting their applications from malicious scripts. This scripting environment may allow an application to be securely scriptable by untrusted third-party script developers.

BACKGROUND

Software applications are often developed following specificrequirements to provide certain capabilities. Although a softwareapplication developer may provide end users with valuable functionality,third party script developers may enhance this basic functionality byproviding extensions, automations, plugins, or similar code which changeor extend software application functionality, making the applicationmore user-friendly. For example, web application developers may create asoftware application for sending and receiving email. The webapplication may include functionality for finding and labeling email.The application may also have a limit on the size capacity of any oneend user's email account. However, the web application may not provideend users with the ability to find email messages over a certain size sothat they can delete large email messages to free up space in theiremail account. A third party script developer may write a plugin that,when added to the email application, can find and label all emailmessages over a certain size. An end user can add the third partydeveloper's plugin to his or her browser and run the plugin to easilyfind large email messages so that these messages can be deleted when theend user's email account reaches size capacity.

Even though third party scripts can improve end user experiences, veryfew software application developers allow untrusted third party scriptsto be added to their web applications because adding third partyfunctionality makes it difficult for a web application developer tomaintain web application security and also makes end users' experienceswith the web application inconsistent.

As illustrated in FIG. 1, customary third party scripts (105) most oftenwork at the web browser-level (101 a, 101 b) and are not an integralpart of software applications. A notable example of browser-level thirdparty scripts is a plugin, which is a software component that cancustomize functionality of a web application. Browser-level scripts areproblematic because they are browser-dependent. If an end user installsa script such as the one shown in FIG. 1 (105) for an application (103a) in one browser (101 a), but then changes the browser (101 b) that heor she is using to access a different instance of the same application(103 b), the end user must install the script in the new browser inorder to obtain the script's functionality for the application. As shownin FIG. 1, script 105's functionality extension of the application isavailable in browser 1 (101 a), but not in browser 2 (101 b) since thescript is not installed in browser 2 (101 b).

There should be a system that allows third-party script to closelyinteract with a host application while still remaining secure. Thesystem should allow software application developers to securely addthird-party scripting functionality to their hosted applications so thatthe third-party scripts can be associated with an end user regardless ofhow the end user is accessing the application.

SUMMARY

This specification describes technologies relating to third partyapplication scriptability in general, and specifically to methods andsystems for allowing third-party script developers to securely addfunctionality to software applications.

In general, one aspect of the subject matter described in thisspecification can be embodied in a system and method for allowingsoftware application developers to incorporate third-party scripts intotheir software applications. An exemplary system includes a scriptingenvironment providing at least one of: authentication on a server,access control, limits on client-side scripting, and management ofscripts. The system may additionally include one or more processingdevices and one or more storage devices that store instructions tocreate a server-side web service that allows communication between athird-party script client and the application server; create aclient-side application programming interface that exposes a subset ofthe application's functionality and resources; allow the third-partyscript access to the application's server via the web service; allow thethird-party script to access the application's functionality andresources using the client-side application programming interface; andprovide an end user with access to the third-party script. A secondexemplary system may include a scripting environment as described above,one or more processing devices, and one or more storage devices storinginstructions that allow a third-party script developer to: receive anapplication programming interface from a software application; receive aweb service from the software application; create a script that changesthe functionality of the software application using the applicationprogramming interface and the web service; and allows end users toaccess the script.

These and other embodiments can optionally include one or more of thefollowing features: a third-party script may define and register atrigger that initiates an action in the third-party script when an eventoccurs in the application; a software application developer may have theability to wrap a web service into a scripting library that can beincluded in a third-party script; a software application developer maybe able to load a third party script into the application through anintegrated development environment; the integrated developmentenvironment may create branding associated with a software application;an end user may be provided with a gallery of application-specificscripts that are available for installation; and an end user may beprovided with a dashboard of currently installed scripts where the usercan manage installed scripts.

The details of one or more embodiments of the invention are set forth inthe accompanying drawings which are given by way of illustration only,and the description below. Other features, aspects, and advantages ofthe invention will become apparent from the description, the drawings,and the claims. Like reference numbers and designations in the variousdrawings indicate like elements.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating a customary embodiment for addingthird-party scripts to a web application.

FIG. 2 is a block diagram illustrating an exemplary embodiment foradding third-party scripts to a web application.

FIG. 3 is a flow diagram of an exemplary method for adding third-partyscripts to a web application.

FIG. 4 is a block diagram illustrating an exemplary computing device.

DETAILED DESCRIPTION

According to an exemplary embodiment, a comprehensive plugin-like systemcan exist that allows software application developers to incorporatethird-party scripts into their applications as illustrated in FIG. 2.The system may provide the flow and mechanisms for enabling a securescripting environment to be added to a hosted software applicationdevelopment environment so that third-party scripts can be incorporatedinto software applications without application developers having to beconcerned about protecting their applications from malicious scripts.This scripting environment may allow an application to be securelyscriptable by untrusted third-party script developers. An exemplaryscripting environment may use Caja for secure scripting. Caja is asubset of javascript that provides object-capability security. Thistechnology provides a JavaScript sandbox which can alter user scriptsand sanitize them by removing precarious method calls. As illustrated inFIG. 2, the application server (109) incorporates the third-partyscripts (105) at the application level so the script plugins areindependent from the browser (101 a, 101 b) used to access instances ofthe application (103 a, 103 b). A user logged into an application willtherefore have the same user experience with the application regardlessof the browser with which the user is accessing the application.

An exemplary system may include both client and server scriptingcomponents, script hosting, a web integrated development environment(IDE), and a way to view all scripts for a given application.

In some embodiments, an exemplary system includes a client/server securescripting environment. This scripting environment may provide some orall of the following features: (1) a cloud integrated developmentenvironment, (2) server-side scripting runtime, (3) script hosting andlibraries, (3) event triggers, (4) account management, (5) built-inapplication programming interfaces (APIs), (6) oAuth integration, (7) asecurable client, (8) scripts that can be granted limited in-browserauthority which cannot produce malicious attacks on software applicationend users, and (9) a per-application gallery to view all scripts thatwere developed for a specific application. A scripting environment mayalso provide authentication on a server, access controls, and limits onclient-side extensions. Additionally, the scripting environment maymanage other details including hosting, server APIs, and accountmanagement. In general, an exemplary system should understand the needsof a web application and define methods for a web application tointeract with a scripting environment in order for the scriptingenvironment and the web application to interact.

An exemplary embodiment may provide different views and functionalitiesfor different groups of intended users. There may be a view for softwareapplication developers, one for third-party script developers, and onefor end users.

Software Application Developers

Using an exemplary system, a software application developer may querythe scripting environment for an end user's installed scripts, load theinstalled scripts on the application's client via a sandboxingtechnology, sandbox the loaded scripts, and allow the loaded scripts tointeract with the application's server using a web service created tointeract with third-party scripts.

An exemplary embodiment may provide a software application developerwith a way to load a script through an integrated developmentenvironment (IDE). This development environment may be preloaded with aweb service for the software application. An IDE may be able tounderstand which application opened the IDE. The application can passalong information regarding special features the application may needwhen it opens the IDE. For example, the application may send a list ofapplication-specific APIs that should autocomplete in the IDE's codeeditor. IDE can be generic and not know about any particular applicationwhile still allowing any application to customize the IDE as needed. TheIDE may also have a way to create branding associated with a softwareapplication. For example, an application's logo and color scheme may becarried over to the IDE.

In some embodiments, an exemplary system may provide softwareapplication developers with the ability to write client-side APIs fortheir applications. A client-side API may include client-side code andDOM of a particular software application that is accessible tothird-party script developers. There may be both standard methods and atemplate/style guide for adding other methods. Application functionalityand resources may be accessed through an application's client-side API.The API defines what application functionality and resources areavailable to third-party developers. For example, in a spreadsheetapplication, a script may be written to show a sidebar every time a userselects a cell that contains a formula. In order for the script to bewritten, the spreadsheet application may provide an API that contains amethod for returning the currently selected cell. The returned cell mayhave properties to determine whether the cell is a formula and providethe cell's value. The spreadsheet API may also contain a method forshowing the sidebar. Methods and properties that an application wouldlike to expose to third-party scripts should be defined within theapplication's API.

An exemplary system may also provide software application developerswith tools for writing a server-side web service that may be accessed bythird-party scripts in order to communicate with applications' servers.These web services may be written using pre-existing APIs that areprovided to software application developers through the scriptingenvironment. These APIs may include REST and SOAP APIs. Alternatively, asoftware application developer may build a library that can be includedin scripts developed by third-party script developers. Softwareapplication developers may create RESTful services which support oAuthauthentication and can be wrapped into a scripting library.

An exemplary embodiment may additionally provide software applicationdevelopers with a way to define and register triggers for theirapplications. A trigger is a mechanism that initiates an action when anevent occurs. Triggers may be application specific and chosen by anapplication developer. Example triggers include: onEdit, onOpen, andonSave. An “onEdit” trigger will fire when an edit occurs in anapplication. An “onOpen” trigger will initiate an action when somethingis opened in an application. An “onSave” trigger will fire whensomething is saved within an application. An application developer mayspecify a list of event names that may be used as triggering events forwhich scripts can be written can be written. Scripts can then register atrigger for a specific event with a broker service so that the script isnotified when the particular event occurs. The event may be recorded andthe event, as well as an optional payload which may be associated withthe event, may be provided to the broker service. The broker service mayrelay news about the triggering event to scripts that are listening forparticular event trigger to fire. The broker service may be a RESTservice and the payload may be written in JSON.

In some embodiments, front-end scripting language code may be providedto load installed scripts into an application on a per end user basis. Afront-end scripting language may be JavaScript for example. Each enduser may want to include a different subset of scripts written for aspecific application. Provided code may find all scripts associated withthe application and load the scripts which the end user currentlyaccessing the application has installed.

In addition to facilitating client/server communications among asoftware application and third-party scripts, an exemplary system mayprovide a software application developer with a URL that links to aframeable web store view so that the software developer can view his orher application as it appears in a web store. An application may beaccessible in a web store so that end users can download and use theapplication. The software application developer's web store view mayinclude a tab for displaying currently installed scripts for thespecific user as well as showing scripts that can be installed.

Third-Party Script Developers

An exemplary system may provide third-party script developers with aserver-side web service per application that is aware of theapplication's context. As discussed above, when scripts run on theexemplary server, the scripts have access to the APIs that theserver-side scripting environment provides. The application's contextincludes data shared within an instance of the application. This data isavailable across all requests from different users. As explained above,an application's web service is written by the application developer andprovided to third-party script developers using the scriptingenvironment. In some embodiments, a third-party script developer mayhave access to a client-side API for an application which the scriptdeveloper can use to access functionality and resources from theapplication in order to write a script for the application. As discussedabove, the client-side API provides a third-party script developer withas much access to the software application as the application developerchooses to grant. The third-party script developer may also have accessto the application event triggers that fire when certain events occur inthe application. An exemplary embodiment may provide synchronous clientAPIs, the ability for a script to manipulate or control non-contiguousregions of an application's user interface, and scripting ability torespond to a user event such as a button click in a way that a browsermay recognize the user event as a direct response to a user action.

An exemplary system may also provide a script developer with anintegrated development environment that may have a specified applicationweb service pre-loaded. This scripting development environment may beaccessible via the application for which the script developer is writingthe script. Additionally, an exemplary system may provide web storeintegration that allows a script developer to specify the applicationfor which the script developer's script has been written.

End Users

End users of software applications that have enabled third-partyscripting may see a gallery of application-specific scripts that areavailable for installation. End users may also have a dashboard ofcurrently installed scripts where users can manage their installedscripts on a per-application basis.

According to an exemplary embodiment, an exemplary method begins withrunning a software application for which third-party scripts have beendeveloped. The software application may be run using an end user'sauthentication credentials and may run code to obtain third-partyscripts for the application that the authenticated end user hasinstalled. URLs may be returned for each script. The scripts may then beloaded and run with the associated web application. Some scripts mayrely on triggers in order to execute, but will listen for triggersassociated with the web application.

As discussed above and illustrated in FIG. 3, according to anotherembodiment, an exemplary system may enable a web application developerto create a server-side web service that exposes a hosted webapplication's functionality and resources (301). The system may alsoallow the web application developer to create a client-side applicationprogramming interface (API) that exposes some of the web application'sfunctionality and resources (303). The web application developer maythen grant configurable access to a third-party script via theapplication programming interface so that the script may interact withthe web application (305). The third-party script may then be allowed toaccess the web application's server via the web service provided by theweb application developer (307). A third-party script developer maydevelop a script that uses the client-side API and the web service tointeract with the web application. An end user may then be provided withaccess to the third-party script and may choose to incorporate thisscript into his or her web application profile (309).

FIG. 4 is a high-level block diagram of an exemplary computer (400) thatis arranged for allowing third-party script developers to securely addfunctionality to software applications using a browser-based scripteditor in a hosted web application execution environment and may be usedto implement systems, apparatus, and methods described within thisdocument. In a very basic configuration (401), the computing device(400) typically includes one or more processors (410) and system memory(420). A memory bus (430) can be used for communicating between theprocessor (410) and the system memory (420).

Depending on the desired configuration, the processor (410) can be ofany type including but not limited to a microprocessor (μP), amicrocontroller (μC), a digital signal processor (DSP), or anycombination thereof. The processor (410) can include one more levels ofcaching, such as a level one cache (411) and a level two cache (412), aprocessor core (413), and registers (414). The processor core (413) caninclude an arithmetic logic unit (ALU), a floating point unit (FPU), adigital signal processing core (DSP Core), or any combination thereof. Amemory controller (416) can also be used with the processor (410), or insome implementations the memory controller (415) can be an internal partof the processor (410).

Depending on the desired configuration, the system memory (420) can beof any type including but not limited to volatile memory (such as RAM),non-volatile memory (such as ROM, flash memory, etc.) or any combinationthereof. System memory (420) typically includes an operating system(421), one or more applications (422), and program data (424). Theapplication (422) may include a method for secure interaction between aweb application and a third-party script in a hosted web applicationexecution environment. Program Data (424) includes storing instructionsthat, when executed by the one or more processing devices, implement asystem and method for allowing third-party script developers to securelyadd functionality to software applications. (423). In some embodiments,the application (422) can be arranged to operate with program data (424)on an operating system (421).

The computing device (400) can have additional features orfunctionality, and additional interfaces to facilitate communicationsbetween the basic configuration (401) and any required devices andinterfaces.

System memory (420) is an example of computer storage media. Computerstorage media includes, but is not limited to, RAM, ROM, EEPROM, flashmemory or other memory technology, CD-ROM, digital versatile disks (DVD)or other optical storage, magnetic cassettes, magnetic tape, magneticdisk storage or other magnetic storage devices, or any other mediumwhich can be used to store the desired information and which can beaccessed by computing device 400. Any such computer storage media can bepart of the device (400).

The computing device (400) can be implemented as a portion of asmall-form factor portable (or mobile) electronic device such as a cellphone, a personal data assistant (PDA), a personal media player device,a wireless web-watch device, a personal headset device, anapplication-specific device, or a hybrid device that include any of theabove functions. The computing device (400) can also be implemented as apersonal computer including both laptop computer and non-laptop computerconfigurations.

The foregoing detailed description has set forth various embodiments ofthe devices and/or processes via the use of block diagrams, flowcharts,and/or examples. Insofar as such block diagrams, flowcharts, and/orexamples contain one or more functions and/or operations, it will beunderstood by those within the art that each function and/or operationwithin such block diagrams, flowcharts, or examples can be implemented,individually and/or collectively, by a wide range of hardware, software,firmware, or virtually any combination thereof. In one embodiment,several portions of the subject matter described herein may beimplemented via Application Specific Integrated Circuits (ASICs), FieldProgrammable Gate Arrays (FPGAs), digital signal processors (DSPs), orother integrated formats. However, those skilled in the art willrecognize that some aspects of the embodiments disclosed herein, inwhole or in part, can be equivalently implemented in integratedcircuits, as one or more computer programs running on one or morecomputers, as one or more programs running on one or more processors asfirmware, or as virtually any combination thereof, and that designingthe circuitry and/or writing the code for the software and or firmwarewould be well within the skill of one of skill in the art in light ofthis disclosure. In addition, those skilled in the art will appreciatethat the mechanisms of the subject matter described herein are capableof being distributed as a program product in a variety of forms, andthat an illustrative embodiment of the subject matter described hereinapplies regardless of the particular type of non-transitory signalbearing medium used to actually carry out the distribution. Examples ofa non-transitory signal bearing medium include, but are not limited to,the following: a recordable type medium such as a floppy disk, a harddisk drive, a Compact Disc (CD), a Digital Video Disk (DVD), a digitaltape, a computer memory, etc.; and a transmission type medium such as adigital and/or an analog communication medium. (e.g., a fiber opticcable, a waveguide, a wired communications link, a wirelesscommunication link, etc.)

With respect to the use of substantially any plural and/or singularterms herein, those having skill in the art can translate from theplural to the singular and/or from the singular to the plural as isappropriate to the context and/or application. The varioussingular/plural permutations may be expressly set forth herein for sakeof clarity.

Thus, particular embodiments of the subject matter have been described.Other embodiments are within the scope of the following claims. In somecases, the actions recited in the claims can be performed in a differentorder and still achieve desirable results. In addition, the processesdepicted in the accompanying figures do not necessarily require theparticular order shown, or sequential order, to achieve desirableresults. In certain implementations, multitasking and parallelprocessing may be advantageous.

What is claimed is:
 1. A system for allowing software applicationdevelopers to incorporate third-party scripts into their softwareapplications, the system comprising: a scripting environment providingat least one of: authentication on a server, access control, limits onclient-side scripting, and management of scripts; one or more processingdevices including one or more processors; and one or more storagedevices storing instructions that, when executed by the one or moreprocessing devices, cause the one or more processing devices to allow asoftware application developer to: create a server-side web service thatallows communication between a third-party script and an applicationserver for a hosted web application and exposes the hosted webapplication's functionality and resources, the third-party script beingbrowser-independent and created external to the software application inwhich the third-party script is being incorporated; create a client-sideapplication programming interface that exposes a subset of the hostedweb application's functionality and resources; allow the third-partyscript access to the application server via the web service; allow thethird-party script to access the hosted web application's functionalityand resources using the client-side application programming interface;and provide an end user with access to the third-party script that isindependent of the browser used to access the hosted web application. 2.The system of claim 1 further comprising allowing the third-party scriptto define and register a trigger that initiates an action in thethird-party script when an event occurs in the application.
 3. Thesystem of claim 1 further comprising allowing a software applicationdeveloper the ability to wrap the web service into a scripting librarythat can be included in the third-party script.
 4. The system of claim 1further comprising allowing a software application developer the abilityto load the third party script into the application through anintegrated development environment.
 5. The system of claim 4 wherein theintegrated development environment creates branding associated with theapplication.
 6. The system of claim 1 further comprising providing anend user with a gallery of application-specific scripts that areavailable for installation.
 7. The system of claim 1 further comprisingproviding an end user with a dashboard of currently installed scriptswhere the user can manage installed scripts.
 8. A system for allowingthird-party script developers to write scripts for software applicationsin a hosted application execution environment, the system comprising: ascripting environment providing at least one of: authentication on aserver, access control, limits on client-side scripting, and managementof scripts; one or more processing devices including one or moreprocessors; and one or more storage devices storing instructions that,when executed by the one or more processing devices, cause the one ormore processing devices to allow a third-party script developer to:receive an application programming interface from a software applicationthat exposes a subset of a hosted application's functionality andresources; receive a server-side web service that allows communicationbetween a third-party script and an application server, and exposes thehosted application's functionality and resources; create a third-partyscript that changes the functionality of the software application usingthe application programming interface and the web service, thethird-party script being browser-independent and created external to thesoftware application in which the third-party script is beingincorporated; and allows end users to access the third-party script thatis independent of the browser used to access the software application.9. A computer-implemented method for allowing software applicationdevelopers to incorporate third-party scripts into their softwareapplications comprising: creating a server-side web service that allowscommunication between a third-party script and an application server fora hosted web application and exposes the hosted web application'sfunctionality and resources, the third-party script being browserindependent and created external to the software application in whichthe third-party script is being incorporated; creating a client-sideapplication programming interface that exposes a subset of the hostedweb application's functionality and resources; allowing the third-partyscript access to the application server via the web service; allowingthe third-party script to access the hosted web application'sfunctionality and resources using the client-side applicationprogramming interface; and providing an end user with access to thethird-party script that is independent of the browser used to access thehosted web application.
 10. The computer-implemented method of claim 9further comprising allowing the third-party script to define andregister a trigger that initiates an action in the third-party scriptwhen an event occurs in the application.
 11. The computer-implementedmethod of claim 9 further comprising allowing a software applicationdeveloper the ability to wrap the web service into a scripting librarythat can be included in the third-party script.
 12. Thecomputer-implemented method of claim 9 further comprising allowing asoftware application developer the ability to load the third partyscript into the application through an integrated developmentenvironment.
 13. The computer-implemented method of claim 12 wherein theintegrated development environment creates branding associated with theapplication.
 14. The computer-implemented method of claim 9 furthercomprising providing an end user with a gallery of application-specificscripts that are available for installation.
 15. A computer-implementedmethod for allowing third-party script developers to write scripts forsoftware applications in a hosted application execution environmentcomprising: receiving an application programming interface from asoftware application that exposes a subset of a hosted application'sfunctionality and resources; receiving a server-side web service thatallows communication between a third-party script and an applicationserver, and exposes the hosted application's functionality andresources; creating a third-party script that changes the functionalityof the software application using the application programming interfaceand the web service, the created third-party script beingbrowser-independent and created external to the software application inwhich the created third-party script is being incorporated; and allowingend users to access the created third-party script that is independentof the browser used to access the software application.